﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace Thingpower.SS.MemberCenter.WebAPI
{
    [RoutePrefix("member/api")]
    public class AccountController : ApiController
    {
        [HttpGet, Route("hello")]
        public IHttpActionResult GetString()
        {
            return Ok("hello");
        }

        [HttpGet, Route("resetpwd")]
        public IHttpActionResult ChangePassword([FromUri]string account, string pwd)
        {
            string error = "";
            bool isSuccess = MemberCenterPlugin.Instance.UserApi.ChangePassword(account, pwd, out error);

            if (isSuccess)
            {
                return Ok("success");
            }
            else
            {
                return Ok(error);
            }
        }
    }
}
